﻿using System;
using JT.WEB.Areas.Identity.Data;
using JTWEB3.Models;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;

namespace JT.WEB.Models
{
    public class ContextUser : IdentityDbContext<JTWEB3User>
    {
        public ContextUser(DbContextOptions<ContextUser> options)
            : base(options)
        {
        }

        protected override void OnModelCreating(ModelBuilder builder)
        {
            base.OnModelCreating(builder);
            // 定制的ASP。NET标识模型，并在需要时覆盖默认值.
            // 例如，您可以重命名ASP。NET标识表名称等。.
            // 在调用base. onmodelcreation (builder)之后添加定制;
            //builder.Entity<IdentityRole>().HasData(
            //    new IdentityRole {Id = "1", Name = "Administrators", NormalizedName = "ADMINISTRATORS" },
            //    new IdentityRole { Name = "WereHouse", NormalizedName = "WEREHOUSE" }
            //    );
            //builder.Entity<JTWEB3User>().HasData(
            //    new JTWEB3User { Id = "1",UserName = "admin@qq.com", Email = "admin@qq.com", Password = "123456", NickName = "管理员" }
            //);
            //builder.Entity<IdentityUserRole<string>>().HasData(
            //    new IdentityUserRole<string> { UserId = "1", RoleId = "1" }
            //    );
        }


    }
}
